using System;
using System.Collections.Generic;
using System.Text;

using WeifenLuo.WinFormsUI.Docking;
using System.Windows.Forms;

namespace Athena.Tools
{
    public class IGUITool : DockContent, ITool
    {
        protected static Model CurrentModel = Program.Model;

        protected bool _bHasContextMenuItems = false;

        /// <summary>
        /// the order in which this tool will be placed
        /// </summary>
        public virtual ToolManager.Order Order 
        { 
            get { return ToolManager.Order.BACK; }
        }

        /// <summary>
        /// Has the tool items to add to the context menu (when right clicked upon in the visual window)
        /// </summary>
        public bool HasContextMenuItems
        {
            get
            {
                return _bHasContextMenuItems;
            }
            set
            {
                _bHasContextMenuItems = value;
            }
        }

        protected bool _bHasMenuItems = false;
        /// <summary>
        /// Has the tool menu items to add into the tool window
        /// </summary>
        public virtual bool HasMenuItems
        {
            get
            {
                return _bHasMenuItems;
            }
        }

        protected bool _bRequiresNewToolWindow = false;
        /// <summary>
        /// Has the tool menu items to add into a separate tool window
        /// </summary>
        public bool RequiresNewToolWindow
        {
            get
            {
                return _bRequiresNewToolWindow;
            }
            set
            {
                _bRequiresNewToolWindow = value;
            }
        }

        public virtual void SetupContextMenu(ToolStripMenuItem oStrip)
        {

        }

        public virtual void SetupToolStrip(ToolStrip oStrip)
        {

        }

        public virtual bool Handles(List<Type> oTypes)
        {
            return false;
        }

        public virtual void SetupDockPanel(WeifenLuo.WinFormsUI.Docking.DockPanel oPanel)
        {

        }
        public virtual void OnItemDoubleClick(HandledMouseEventArgs e)
        {           
        }

        public virtual void ShowHide_Click(object sender, EventArgs e)
        {
            if (IsHidden)
            {
                Show();                
            }
            else
            {
                Hide();
            }
        }
        public virtual new void Show()
        {
            if (DockPanel != null)
            {
                base.Show(DockPanel);
                Utility.Panel.Focus();
            }
        }
        public virtual new void Hide()
        {
            base.Hide();
        }
        public virtual void oItem_Click(object sender, EventArgs e)
        {
        }
        public virtual void OnMouseMove(HandledMouseEventArgs e)
        {

        }

        public virtual void OnMouseUp(HandledMouseEventArgs e)
        {

        }

        public virtual void OnMouseDown(HandledMouseEventArgs e)
        {
        }


        public new virtual void OnKeyDown(KeyEventArgs args)
        {

        }

        public new virtual void OnKeyUp(KeyEventArgs args)
        {

        }
    }
}
